CC = gcc -pthread  -D_GNU_SOURCE -Wall -Werror

all: CC += -O2
all:pthread_helloworld contextswitch

debug: CC += -DDEBUG -g
debug: pthread_helloworld
debug: contextswitch

pthread_helloworld: pthread_helloworld.o
	$(CC) -o pthread_helloworld  pthread_helloworld.o

pthread_helloworld.o: pthread_helloworld.c
	$(CC) -c pthread_helloworld.c
	
contextswitch: contextswitch.c
	$(CC) contextswitch.c -o contextswitch
	
clean:
	rm -rf *o pthread_helloworld contextswitch